package com.zhang.visitor;

//观察者模式

public class Client {
    public static void main(String[] args) {

        Home home = new Home();//创建Home对象中
        home.add(new Dog());
        home.add(new Cat());

        Owner owner = new Owner();
        home.action(owner);//让主人喂食所有宠物
    }
}
